package sort;

public class CountingSort {
    public static void process(int[] arr,int length) {
        int[] bucketArr = new int[101];
        for (int i = 0; i <arr.length; i++) {
           bucketArr[arr[i]]++;
        }
        int count = 0;
        int j =0;
        for (int i = 0; i <bucketArr.length ; i++) {
            if (bucketArr[i]!=0){
                count = bucketArr[i];
                while (count-->0){
                    arr[j++] = i;
                }
            }
        }
    }
}
